package top.oneit.jdownload.test;

import com.jfoenix.controls.JFXButton;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

import java.net.URL;

/**
 * @author lingkang
 */
public class JfTest01 extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {
        AnchorPane anchorPane=new AnchorPane();
        anchorPane.setPrefHeight(100);
        anchorPane.setPrefWidth(100);

        JFXButton jfxButton=new JFXButton("按钮");
        jfxButton.setLayoutX(10);
        jfxButton.setLayoutY(0);
        jfxButton.setStyle("-fx-background-color: #409eff");// 背景颜色

        // 限制图片宽高
        ImageView imageView = new ImageView("/assets/茶壶.png");
        imageView.setFitWidth(16);
        imageView.setFitHeight(16);
        JFXButton button=new JFXButton("图片按钮",imageView);
        button.setLayoutX(10);
        button.setLayoutY(40);









        // 加载 xml
        URL resource = getClass().getResource("/fxml/test/Checkbox.fxml");
        StackPane load = FXMLLoader.load(resource);

        primaryStage.setScene(new Scene(load));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
